package com.motion.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.motion.generator.entity.OrderCopy1;
import com.motion.generator.mapper.OrderCopy1Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderCopy1Service {
    @Autowired(required = false)
    OrderCopy1Mapper orderCopy1Mapper;
    //分页查询 ，page是页数，size是页的大小
    public List<OrderCopy1> cheak(Long page, Long size){
        //条件构造器
        QueryWrapper queryWrapper=new QueryWrapper();
        List<OrderCopy1> ref=orderCopy1Mapper.selectPage(new Page<>(page,size),queryWrapper).getRecords();
        return ref;
    }

    public OrderCopy1 insertOrderCopy1Dto(OrderCopy1 orderCopy1){
        orderCopy1Mapper.insert(orderCopy1);
        return orderCopy1;
    }

    public boolean deleteOrderCopy1(Long orderCopy1Id) {
        orderCopy1Mapper.deleteById(orderCopy1Id);
        return true;
    }
}